﻿#region Imports
using System;
using System.Diagnostics;
using System.Windows.Forms;
using CommonUtilities.Extensions;
using CommonUtilities.Info;
#endregion

namespace CommonUtilities.Views
{
    public partial class frmAbout : Form
    {
        #region Constructors
        public frmAbout()
        {
            InitializeComponent();
            this.StartPosition = this.Parent.IsNull() 
                ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent;

            this.Text = String.Format("About {0}", AppInfo.AssemblyTitle);
            this.txtProductName.Text = AppInfo.AssemblyProduct;
            this.txtVersion.Text = String.Format("v{0}", AppInfo.AssemblyVersion);
            this.txtCopyright.Text = AppInfo.AssemblyCopyright;
            this.txtCompanyName.Text = AppInfo.AssemblyCompany;
            this.txtDescription.Text = AppInfo.AssemblyDescription;
        }
        #endregion

        #region Events
        private void btnOk_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void lnkAuthor_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("mailto:" + lnkAuthor.Text);
        }
        #endregion
    }
}
